/*
    This file is part of open-wars <http://code.google.com/p/open-wars/>.

    open-wars is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    open-wars is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with open-wars.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef input_interface_h
#define input_interface_h

#include <common-datatypes.h>

typedef void(*IInputCallback)(void*);


// Keyboard Callbacks
extern IInputCallback onKeyDown;
extern IInputCallback onKeyUp;

// Mouse Callbacks
extern IInputCallback onMouseMove;
extern IInputCallback onMouseButtonDown;
extern IInputCallback onMouseButtonUp;

/* *************************************************************************
    The following MUST be #defined by the implementation:
        CWK_F1       
        CWK_F2       
        CWK_F3       
        CWK_F4       
        CWK_F5       
        CWK_F6       
        CWK_F7       
        CWK_F8       
        CWK_F9       
        CWK_F10      
        CWK_F11      
        CWK_F12      
        CWK_LEFT     
        CWK_UP       
        CWK_RIGHT    
        CWK_DOWN     
        CWK_PAGE_UP  
        CWK_PAGE_DOWN
        CWK_HOME     
        CWK_END      
        CWK_INSERT   
   ************************************************************************* */


typedef struct
{
    int mouseX;
    int mouseY;
} MousePosResult;



class IInputInterface
{
	public:
		// General Functions
		virtual void Initialize				(void)						{ };
	    
		// Keyboard Callbacks
		virtual void SetOnKeyDown			(IInputCallback callback)	{ onKeyDown = callback; };
		virtual void SetOnKeyUp				(IInputCallback callback)	{ onKeyUp = callback; };
		
		// Mouse Callbacks
		virtual void SetOnMouseMove			(IInputCallback callback)	{ onMouseMove = callback; };
		virtual void SetOnMouseButtonDown	(IInputCallback callback)	{ onMouseButtonDown = callback; };
		virtual void SetOnMouseButtonUp		(IInputCallback callback)	{ onMouseButtonUp = callback; }; 
        virtual MousePosResult GetMousePos  (void)                      { MousePosResult res; return res; }
};

#endif // input_interface_h
